<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>店铺登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="viewport" content="width=320.1, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <%@ include file="/WEB-INF/views/common/resource.jsp" %>
</head>
<script>
    var sms_type="login_sms";
    function getSmsCode() {
        var mobile = $('#mobile').val();
        sendSmsCode(mobile,sms_type);
    }

    function doShopLogin() {
        var mobile = $('#mobile').val();
        var code = $('#sms-code').val();

        $.ajax({
            type: "post",
            url: '/user/doShopLogin.do',
            dataType: "json",
            data: {
                'mobile' : mobile,
                'code' : code
            },
            success: function(resp){
                console.log(resp);
                if(resp.result==="success"){
                    location.href="${ctx}/shop/shopIndex.do"
                }else{
                    alertTips(resp.msg)
                }
            }
        });
    }

</script>
<body>

    <div class="page">
        <div class="login_box">
            <img class="logo" src="${rtx}/images/logo.png" width="50%" />
            <!-- 经销商&配送员登录输入字段 -->
            <div class="input_box phone">
                <input type="text" id="mobile" placeholder="请输入您的手机号" />
            </div>
            <div class="yzm_box">
                <div class="input_box">
                    <input  id="sms-code" type="text" placeholder="请填写验证码" />
                </div>
                <input style="font-size: 15px;" id="send-sms-code" type="button" value="获取验证码" onclick="getSmsCode()" />
            </div>
            <div class="clear"></div>


            <input type="button" id="login" value="店铺登录" onclick="doShopLogin()" />
            <!-- 经销商&配送员页面没有注册与忘记密码按钮 -->
            <p style="float: left"><a onclick="location.href='${ctx}/user/toRegisterShop.do'">注册店铺</a></p>

        </div>
    </div>
</body>
</html>
